<?php 
namespace app\index\model;

use think\Model;
use think\Db;

/**
* 
*/
class Post extends Model
{
	if(!cache('hotTopic')){
		$hotTopic = Db::table('post')
		->field('pid,title,answer_num')
		->where('ctime','>',strtotime("-7 days"))
		->order('answer_num desc')
		->limit(10)
		->select();

		cache('hotTopic',$hotTopic,600);
		return $hotTopic;
	}else{
		return cache('hotTopic');
	}
}





 ?>